\hypertarget{main_8cpp}{
\section{src/main/main.cpp File Reference}
\label{main_8cpp}\index{src/main/main.cpp@{src/main/main.cpp}}
}


the file containing the main function, the call to the parser, and graph traversal code Adapted from examples by Terence Parr \& Jim Idle  


{\ttfamily \#include $<$laban.h$>$}\par
{\ttfamily \#include $<$translate.h$>$}\par
{\ttfamily \#include $<$check.h$>$}\par
{\ttfamily \#include $<$iostream$>$}\par
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{main_8cpp_a36b5bdbf83ef632933b1b25dbd327fa9}{visit} (\hyperlink{laban_8h_a65ea7c6f5eeefe01fdbde7195d08dcfb}{DAGnode} parent, \hyperlink{laban_8h_a65ea7c6f5eeefe01fdbde7195d08dcfb}{DAGnode} child, int first, ofstream \&fout)
\begin{DoxyCompactList}\small\item\em This function is used to print information about an edge to a file output stream when traversing the graph. \item\end{DoxyCompactList}\item 
void \hyperlink{main_8cpp_a271c0172a11d7f55876b85b073e34875}{traverse} (string strfname)
\begin{DoxyCompactList}\small\item\em This function is used to traverse the graph. \item\end{DoxyCompactList}\item 
int ANTLR3\_\-CDECL \hyperlink{main_8cpp_adc6f6700803eb6f84aaaa49fe039bfc9}{main} (int argc, char $\ast$argv\mbox{[}$\,$\mbox{]})
\begin{DoxyCompactList}\small\item\em This is the main function. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
DAGedges \hyperlink{main_8cpp_a343bd0cad9873ef4a5630df5eca57e62}{DAG}
\begin{DoxyCompactList}\small\item\em DAG is a global variable that, essentially, holds a collection of edges. \item\end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
the file containing the main function, the call to the parser, and graph traversal code Adapted from examples by Terence Parr \& Jim Idle 

\subsection{Function Documentation}
\hypertarget{main_8cpp_adc6f6700803eb6f84aaaa49fe039bfc9}{
\index{main.cpp@{main.cpp}!main@{main}}
\index{main@{main}!main.cpp@{main.cpp}}
\subsubsection[{main}]{\setlength{\rightskip}{0pt plus 5cm}int ANTLR3\_\-CDECL main (int {\em argc}, \/  char $\ast$ {\em argv}\mbox{[}$\,$\mbox{]})}}
\label{main_8cpp_adc6f6700803eb6f84aaaa49fe039bfc9}


This is the main function. 

It is mainly taken from the code written by Jim Idle. We only changed the name of the parser and added one line that calls the traverse function \hypertarget{main_8cpp_a271c0172a11d7f55876b85b073e34875}{
\index{main.cpp@{main.cpp}!traverse@{traverse}}
\index{traverse@{traverse}!main.cpp@{main.cpp}}
\subsubsection[{traverse}]{\setlength{\rightskip}{0pt plus 5cm}void traverse (string {\em strfname})}}
\label{main_8cpp_a271c0172a11d7f55876b85b073e34875}


This function is used to traverse the graph. 


\begin{DoxyParams}{Parameters}
\item[{\em strfname,:}]a string that holds the name of the file that will be printed to. This function will open a file output stream to which it will print a list of edges, by repeatedly calling the visit function. A node is printed, followed by the list of its children. \end{DoxyParams}
\hypertarget{main_8cpp_a36b5bdbf83ef632933b1b25dbd327fa9}{
\index{main.cpp@{main.cpp}!visit@{visit}}
\index{visit@{visit}!main.cpp@{main.cpp}}
\subsubsection[{visit}]{\setlength{\rightskip}{0pt plus 5cm}void visit ({\bf DAGnode} {\em parent}, \/  {\bf DAGnode} {\em child}, \/  int {\em first}, \/  ofstream \& {\em fout})}}
\label{main_8cpp_a36b5bdbf83ef632933b1b25dbd327fa9}


This function is used to print information about an edge to a file output stream when traversing the graph. 


\begin{DoxyParams}{Parameters}
\item[{\em parent}]a pair $<$string,int$>$ representing the parent node of the edge \item[{\em child}]a pair $<$string,int$>$ representing the child node of the edge \item[{\em first}]a flag set by the caller to indicate whether information about the parent should be printed \item[{\em fout}]the file output stream to which information will be sent. \end{DoxyParams}


\subsection{Variable Documentation}
\hypertarget{main_8cpp_a343bd0cad9873ef4a5630df5eca57e62}{
\index{main.cpp@{main.cpp}!DAG@{DAG}}
\index{DAG@{DAG}!main.cpp@{main.cpp}}
\subsubsection[{DAG}]{\setlength{\rightskip}{0pt plus 5cm}DAGedges {\bf DAG}}}
\label{main_8cpp_a343bd0cad9873ef4a5630df5eca57e62}


DAG is a global variable that, essentially, holds a collection of edges. 

Each edge is in fact a pair of nodes, which in turn, are represented as a pair whose first term is a string, (the node ID) and whose second term is an int (which is an auxiliary value that helps determine certain attributes of the node 